Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Managing the Video Frame Playback Rate

QuickTime 2.1 introduced two new functions for determining the rate at which a QuickTime movie plays back each video frame. You should use these functions for debugging.

VideoMediaGetStatistics

The VideoMediaGetStatistics function returns the play-back frame rate of a movie. This call can only be used on video or MPEG media handlers.

pascal Fixed VideoMediaGetStatistics (
                     MediaHandler mh);
mh
Contains a reference to a video media handler. You obtain this reference from the GetMediaHandler function.

function result
Returns the movie's play-back frame rate in frames per second.

Description

The VideoMediaGetStatistics returns the average frame rate since the last time VideoMediaResetStatistics was called. Because of sampling errors, the values returned from VideoMediaGetStatistics are accurate only after waiting at least one second after calling VideoMediaResetStatistics .

Note
Because not all QuickTime movies have a constant frame rate, the results of this call can be difficult to interpret correctly. For this reason, the results of this function should not be displayed in a place where a novice user is likely to see it.

VideoMediaResetStatistics

Use the VideoMediaResetStatistics function to reset the video media handler's counters before using VideoMediaGetStatistics to determine the frame rate of a movie. This call can only be used on video or MPEG media handlers.

pascal HandlerError VideoMediaResetStatistics (
                     MediaHandler mh);
mh
Contains a reference to a video media handler. You obtain this reference from the GetMediaHandler function.

function result
Returns a handle error.

Description

The VideoMediaResetStatistics function resets the video media handler's frame rate counters.

RESULT CODES

badComponentInstance 0x80008001 Invalid component instance specified.

© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |